<div class="ibox">
        <div class="ibox-title">
        <h5>系统节点管理</h5>
        <div class="nowrap pull-right" style="margin-top:10px">
	    <button data-modal='node/form' data-title="添加节点" class='layui-btn layui-btn-small'><i class='fa fa-plus'></i> 添加节点</button>
	 	</div>
    </div>
    
        <div class="ibox-content fadeInUp animated">
<table class="table table-hover">
    <thead>
        <tr>
            <th style="width:20px"></th>
            <th class='text-left'>节点</th>
            <th class='text-left'></th>
            <th class='text-left'></th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
        <#if nodes??>
           <#list nodes as node>
           <#if node.pid==0>
           <tr>
				<td style="width:10px"></td>
	            <td class='text-left nowrap'>
	                ${node.node!""}
	                &nbsp;<input class='layui-input layui-input-inline title-input' style='height:28px;line-height:28px;width:auto' name='title' value="${node.title!''}" data-nid="${node.id?c}"/>
	            </td>
	            <td style="width:10px"></td>
	            <td style="width:10px"></td>
	            <td style="width:10px"></td>
           </tr>
           <#else>
           <tr>
            <td style="width:10px"></td>
            <td class='text-left nowrap'>
                ${node.key!""}${node.node!""}
                &nbsp;<input class='layui-input layui-input-inline title-input' style='height:28px;line-height:28px;width:auto' name='title' value="${node.title!''}" data-nid="${node.id?c}"/>
            </td>
            <td class='text-left nowrap'>
                <span>
                    <#if node.auth>
                    <input name='is_auth' checked='checked' class="check-box" type='checkbox' value='1' data-nid="${node.id?c}"/>
                    <#else>
                    <input name='is_auth' class="check-box" type='checkbox' value='1' data-nid="${node.id?c}"/>
                    </#if>
                    加入权限控制
                </span>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <span>
                    <#if node.menu>
                    <input name='is_menu' checked='checked' class='check-box' type='checkbox' value='1' data-nid="${node.id?c}"/>
                   	<#else>
                    <input name='is_menu' class='check-box' type='checkbox' value='1' data-nid="${node.id?c}"/>
                    </#if>
                    可设为菜单
                </span>
            </td>
            <td class='text-center nowrap'>
            	<div class="nowrap pull-right" style="margin-left:20px">
			    <button data-modal='node/select_pnode?id=${node.id?c}' data-title="选择父节点" class='layui-btn layui-btn-small'>选择父节点</button>
			 	</div>
                    
            </td>
            <td style="width:100%"></td>
        </tr>
           </#if>
        </#list>  
            <#else>
             <tr><td colspan=6 class='text-center'>还没有数据！</td></tr>
            </#if>
    </tbody>
</table>
</div>
</div>
<script>
    $(function () {
        $('input.title-input').on('blur', function () {
            $.form.load('node/edit', {name: this.name, value: this.value,'data-id':$(this).attr("data-nid")}, 'POST', function (ret) {
                return false;
            });
        });
        $('input.check-box').on('click', function () {
            $.form.load('node/edit', {name: this.name, value: this.checked ? 1 : 0,'data-id':$(this).attr("data-nid")}, 'POST', function (ret) {
                return false;
            });
        });
    });
</script>
